package com.practice;

import java.util.Random;
import java.util.Scanner;

public class NumberGame {

    public static void main(String[] args) {
        Random random = new Random();
        Scanner scanner = new Scanner(System.in);
        boolean c = true;
        while (c) {
            int target = random.nextInt(100) + 1;
            System.out.println("==>" + target);
            while (true) {
                int input = scanner.nextInt();
                if (input < 0) {
                    c = false;
                    break;
                } else if (target > input) {
                    System.out.println("猜小了");
                } else if (target < input) {
                    System.out.println("猜大了");
                } else {
                    System.out.println("猜中了！！");
                    break;
                }
            }
        }
    }


}
